package youcaihuaoa.weetop.com.ui.adapter

import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.robot.base.common.api.GlBaseApi
import com.robot.base.model.ExamineBean
import com.robot.base.model.UserInfoBean
import com.robot.base.utils.pic.ImageLoaderUtils
import youcaihuaoa.weetop.com.R

class FriendAdapter(private val onAddListener: (pos: Int) -> Unit) :
    BaseQuickAdapter<UserInfoBean, BaseViewHolder>(
        R.layout.app_item_friend,

        ) {
    override fun convert(holder: BaseViewHolder, item: UserInfoBean) {
        ImageLoaderUtils.displayCircle(
            context, holder.getView(R.id.iv_avatar), GlBaseApi.PIC_BASE_URL + item.head_img
        )
        holder.setText(R.id.tv_name, item.user_name)
        holder.setText(R.id.tv_job, item.job_name)
        holder.getView<View>(R.id.tv_add).setOnClickListener {
            onAddListener.invoke(holder.absoluteAdapterPosition)
        }
    }
}